#ifndef TALISMAN_H
#define TALISMAN_H

#include <QtGui/QMainWindow>
#include "ui_talisman.h"
#include "qboxlayout.h"
#include "IReceiver.h"
#include "Outcome.h"
#include <iostream>
#include "Die.h"

using namespace std;

// Forward declarations
class QAction;    //provides an abstract user interface action that can be inserted into widget.
class QActionGroup; //Groups actions together.
class QLabel;   //Provides a text or image display.
class QMenu;     //Provides a menu widget for use in menu bars, context menus, and other popup menus.
class QPushButton;  //Provides a command button.
class PositionKeeper;
class PlayerCharacter;
class MagicObject;
class PlayerArea;
class NonPlayerCharacter;
class AdventureCardArea;
namespace talisman_map { class Map; };

class Talisman : public QMainWindow, public IReceiver
{
	Q_OBJECT

public:
	Talisman(QWidget *parent = 0, Qt::WFlags flags = 0);
	virtual ~Talisman();

	// Instruction methods
	virtual void drawOneAdventureCard(void) override;
	virtual Outcome::Outcome fightTiger(void) override;
	virtual Outcome::Outcome fightBear(void) override;
	virtual void loseOneLife(void) override;
	virtual void winTheGame(void) override;
	virtual void restartGame(void) override;
	virtual void becomeToad(void) override;

protected:

	private slots:
		void goForward();
		void goBack();
		void takeBridge();
		void usePortal();
		void loadMap();
		void rollDie();
		void loadCharacter();
		void editCharacter();
		void editMap();
		void useAdvCard();

private:
	void showInfo(void);
	void setup(void);

	QActionGroup *alignmentGroup;

	PositionKeeper *mPositionKeeper;
	PlayerCharacter * mPlayer;
	talisman_map::Map *map;
	Die die;

	QWidget * leftPanel;
	QPushButton *mLoadMapButton ;
	QPushButton *mRollDie ;
	QPushButton *mBackButton ;
	QPushButton *mForwardButton;
	QPushButton *mBridgeButton;
	QPushButton *mPortalButton;
	QPushButton *mLoadCharacterButton;
	QPushButton *mEditMapButton;
	QPushButton *mEditCharacterButton;
	QPushButton *mUseAdventureCardButton;

	PlayerArea *mArea;
	QHBoxLayout *layout;
	AdventureCardArea *mAdventureCardArea;

	string characterFileName;
	string mapFileName;
};

#endif // TALISMAN_H
